package com.knife.scheduler.infra.registry;

import com.knife.scheduler.infra.KnifeJobMarker;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 已注册任务本地缓存
 *
 * @author： 76875
 * @date： 2022/4/1 星期五 18:48
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
public class KnifeJobRegistry {


    private static Map<String, KnifeJobMarker> jobMap = new ConcurrentHashMap<>();


    public static void addJobHandler(String jobCode, KnifeJobMarker jobMarker) {
        jobMap.put(jobCode, jobMarker);
    }

    public static KnifeJobMarker getJobHandler(String jobCode) {
        return jobMap.get(jobCode);
    }
}
